#ifndef _PW_ENTITIES__H_
#define _PW_ENTITIES__H_

#include <string>
#include "RapidJsonHelper.h"
using namespace RapidJsonHelper;

#define PW_SYNTHESIZE(varType, varName, funName)\
protected: varType varName;\
public: varType get##funName(void) const { return varName; }\
public: void set##funName(varType var){ varName = var; }
#define PW_SYNTHESIZE_PASS_BY_REF(varType, varName, funName)\
protected: varType varName;\
public: const varType& get##funName(void) const { return varName; }\
public: void set##funName(const varType& var){ varName = var; }
#define PW_SYNTHESIZE_RETAIN(varType, varName, funName)    \
private: varType varName; \
public: varType get##funName(void) const { return varName; } \
public: void set##funName(varType var)   \


class BasicInfo : public JsonBase
{
	PW_SYNTHESIZE_PASS_BY_REF(std::string, OrderId, OrderId)						//订单号
	std::string _M_user_ip;
public:
	BasicInfo(){}
	~BasicInfo() {}

public:
	static const UINT			TYPECODE = 0;
	void ToWrite(Writer<StringBuffer> &writer)
	{
		RapidjsonWriteBegin(writer);
		RapidjsonWriteString(OrderId);
		RapidjsonWriteEnd();
	}
	void ParseJson(const Value& val)
	{
		RapidjsonParseBegin(val);
		RapidjsonParseToString(OrderId);
		RapidjsonParseEnd();
	}

	void setUserIp(std::string const & ip)
	{
		_M_user_ip = ip;
	}

	std::string const & getUserIp()
	{
		return _M_user_ip;
	}
};

#endif
